﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RFIDStockManagement.Model.Public
{
    /// <summary>
    /// 出库单
    /// </summary>
    public class OutStockBill
    {
         private long _FID;
        private int _FBillerID;
        private string _FOutStockPerson;
        private long _FStockID;
        private string _FNote;

        private DateTime _FBillDate;
        private List<InStockBillEntry> entries;

        public OutStockBill()
        {
            entries = new List<InStockBillEntry>();
        }

        #region  属性

        /// <summary>
        /// 明细
        /// </summary>
        public List<InStockBillEntry> Entries
        {
            get { return entries; }
            set { entries = value; }
        }
        /// <summary>
        /// 仓库
        /// </summary>
        public long FStockID
        {
            get { return _FStockID; }
            set { _FStockID = value; }
        }

        /// <summary>
        /// 出库时间
        /// </summary>
        public DateTime FBillDate
        {
            get { return _FBillDate; }
            set { _FBillDate = value; }
        }

        /// <summary>
        /// 领料人
        /// </summary>
        public string FOutStockPerson
        {
            get { return _FOutStockPerson; }
            set { _FOutStockPerson = value; }
        }

        /// <summary>
        /// 用途
        /// </summary>
        public string FNote
        {
            get { return _FNote; }
            set { _FNote = value; }
        }

        /// <summary>
        /// 录单人ID
        /// </summary>
        public int BillerID
        {
            get { return _FBillerID; }
            set { _FBillerID = value; }
        }

        /// <summary>
        /// 单据内码
        /// </summary>
        public long FID
        {
            get { return _FID; }
            set { _FID = value; }
        }
        #endregion

        #region IInventory 成员

        public List<InventoryData> GetInventoryDatas()
        {
            List<InventoryData> newInventories = new List<InventoryData>();

            foreach (InventoryData x in entries)
            {
                x.FStockId = _FStockID;
                newInventories.Add(x);
            }
            return newInventories;
            
        }

        #endregion
    }
}
